package fr.mairie.parc.dao.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import fr.mairie.parc.domain.Materiel;

public class MaterielResultSetExtractor implements ResultSetExtractor {

	@Override
	public Object extractData(ResultSet rs) throws SQLException,
			DataAccessException {
		Materiel materiel = new Materiel();
		materiel.setIdMateriel(rs.getInt(1));
		materiel.setNumParc(rs.getInt(2));
		materiel.setType(rs.getString(3));
		materiel.setMarque(rs.getString(4));
		materiel.setModele(rs.getString(5));
		materiel.setStock(rs.getString(6));
		materiel.setPrix(rs.getDouble(7));
		return materiel;
	}

}
